package com.openbravo.data.user;

import com.openbravo.basic.BasicException;
import com.openbravo.data.loader.SentenceExec;
import com.openbravo.data.loader.TableDefinition;

public class SaveProvider
{
  protected SentenceExec m_sentupdate;
  protected SentenceExec m_sentinsert;
  protected SentenceExec m_sentdelete;

  public SaveProvider(SentenceExec paramSentenceExec1, SentenceExec paramSentenceExec2, SentenceExec paramSentenceExec3)
  {
    this.m_sentupdate = paramSentenceExec1;
    this.m_sentinsert = paramSentenceExec2;
    this.m_sentdelete = paramSentenceExec3;
  }
  
 public TableDefinition paramTableDefinitionQ11;

  public SaveProvider(TableDefinition paramTableDefinition)
  {
    this.m_sentupdate = paramTableDefinition.getUpdateSentence();
    this.m_sentdelete = paramTableDefinition.getDeleteSentence();
    this.m_sentinsert = paramTableDefinition.getInsertSentence();
    paramTableDefinitionQ11= paramTableDefinition;
  }

  public SaveProvider(TableDefinition paramTableDefinition, int[] paramArrayOfInt)
  {
    this.m_sentupdate = paramTableDefinition.getUpdateSentence(paramArrayOfInt);
    this.m_sentdelete = paramTableDefinition.getDeleteSentence();
    //com.openbravo.data.loader.TableDefinition@4f8d21
    this.m_sentinsert = paramTableDefinition.getInsertSentence(paramArrayOfInt);
  }

  public boolean canDelete()
  {
    return this.m_sentdelete != null;
  }

  public int deleteData(Object paramObject)
    throws BasicException
  {
    return this.m_sentdelete.exec(paramObject);
  }

  public boolean canInsert()
  {
    return this.m_sentinsert != null;
  }

  public int insertData(Object paramObject)
    throws BasicException
  {
	  //m_sentinsert===com.openbravo.data.loader.PreparedSentence@13f567d
    return this.m_sentinsert.exec(paramObject);
  }

  public boolean canUpdate()
  {
    return this.m_sentupdate != null;
  }

  public int updateData(Object paramObject)
    throws BasicException
  {
    return this.m_sentupdate.exec(paramObject);
  }
}

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.data.user.SaveProvider
 * JD-Core Version:    0.6.0
 */